package chixing.day08.work;

public class MySavingsAccount extends BankAccount {

    public MySavingsAccount(String accountNumber, double initialBalance) {
        super(accountNumber, initialBalance);
    }

    // 每月更新：添加2%的利息
    @Override
    public void monthlyUpdate() {
        double interest = getBalance() * 0.02;
        setBalance(getBalance() + interest);
        System.out.println("储蓄账户月度更新: 获得利息 " + interest + " 元，更新后余额: " + getBalance() + " 元");
    }
}
